package com.singulee.carschool.mapper;

import com.singulee.carschool.pojo.Cart;
import com.singulee.carschool.pojo.Repair;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;
@Mapper
public interface RepairMapper {
    /**
     * 获得总数据
     * @param map
     * @return
     */
    Integer getHistoryCount(Map map);

    /**
     * 获得返回数据
     * @param map
     * @return
     */
   List<Map<String,Object>> getHistory(Map map);

    /**
     * 当前使用的车辆
     * @param map
     * @return
     */
    List<Map<String,Object>> getlocalCart(Map map);

    /**
     * 获得空闲车辆
     * @param map
     * @return
     */
    @Select("select * from cart where staute = '备用'")
    List<Cart> getNullCar(Map map);


   List<Map<String,Object>> getDetail(Map map);

    int deleteByPrimaryKey(Integer repairid);


    int insert(Repair record);


    int insertSelective(Repair record);


    Repair selectByPrimaryKey(Integer repairid);


    int updateByPrimaryKeySelective(Repair record);

    int updateByPrimaryKey(Repair record);

//    @Select(" select c.carId,carNumber,r.repairTime,r.repairId,r.cause,r.comebackTime,r.extend1,r.extend2,t.teaName,t.teaId,t.teaPhone from cart c,repair r,teacher t where t.teaId=r.teacherId and r.cartId =c.carId")
    List<Map<String, Object>> getXinxi(String carNumber, String staute);

}